package com.chasing.baseframe.db.dao;

import androidx.room.Dao;
import androidx.room.Query;

import com.chasing.baseframe.db.base.BaseDao;
import com.chasing.baseframe.db.entity.FileDownloadCacheEntity;

import java.util.List;

import io.reactivex.rxjava3.core.Single;

@Dao
public interface FileDownloadCacheDao extends BaseDao<FileDownloadCacheEntity> {

    @Query("SELECT * FROM FileDownloadCacheEntity")
    Single<List<FileDownloadCacheEntity>> loadAll();

    @Query("SELECT * FROM FileDownloadCacheEntity where mUrl = :url")
    Single<List<FileDownloadCacheEntity>> getCacheByUrl(String url);
}
